﻿@model SuCasa.Models.CallLogViewModel
@{
    ViewBag.Title = "add";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="tabbable">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#add" data-toggle="tab">Add</a> </li>
        <li><a href="#history" data-toggle="tab">History</a> </li>
    </ul>
    <div class="tab-content">
        <div class="tab-pane active" id="add">
            <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
            <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
            @using (Html.BeginForm())
            {
                @Html.ValidationSummary(true)
                @Html.HiddenFor(x => x.ReceivedByMemberId)
@*Html.HiddenFor(x => x.CallLogId)*@
     
                <table class="table table-striped table-bordered">
                    <tr>
                        <td class="span2"><b>Member Name</b></td>
                        <td>
                            <div class="control-group">
                                @Html.DisplayFor(model => model.Name, new { @class = "input-xlarge" })
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td><b>Home Phone</b></td>
                        <td>
                            <div class="control-group">
                                @Html.DisplayFor(model => model.PhoneNumber, new { @class = "input-xlarge" })
                            </div>
                        </td>
                    </tr>
                    <tr>
                    <td><b>Cell Phone</b></td>
                        <td>
                            <div class="control-group">
                                @Html.DisplayFor(model => model.CellPhone, new { @class = "input-xlarge" })
                            </div>
                        </td>
                    </tr>
                </table>

        
                <div class="control-group">
                    <label class="control-label">
                        Note</label>
                    <div class="controls">
                        @Html.TextAreaFor(model => model.Note, new { @class = "input-xlarge", style = "height:200px;width:600px;" })
                        @Html.ValidationMessageFor(model => model.Note)
                    </div>
                </div>

                <div class="form-actions">
                    <input type="submit" class="btn btn-primary" value="Create" />
                </div>
            }
            <div>
                @Html.ActionLink("Back to List", "Index", "Home")
            </div>
        </div>
        <div class="tab-pane" id="history">
            <table class="table table-striped table-bordered">
                <tr>
                    <td>
                        <b>Member Name</b>
                    </td>
                    <td>
                        <b>Notes</b>
                    </td>
                    <td>
                        <b>Timestamp</b>
                    </td>
                </tr>
                @foreach (SuCasa.Infrastructure.CallLog item in Model.CallLogs)
                {
                    <tr>
                        <td>
                            @String.Format("{0} {1}", item.ReceivedByMember.FirstName, @item.ReceivedByMember.LastName)
                        </td>
                        <td>
                            @item.Note
                        </td>
                        <td>
                            @String.Format("{0} {1}", item.DateTime.ToShortTimeString(), item.DateTime.ToShortDateString())
                        </td>
                    </tr>
                }
            </table>
        </div>
    </div>
</div>
